#ifndef WUZIQI_H
#define WUZIQI_H

#include <QMainWindow>
#include <QPaintEvent>
#include <item.h>
#include <QVector>
#include <QMouseEvent>
#include <QPainter>

#define CHESS_ROWS		25
#define CHESS_COLUMES	25
#define RECT_WIDTH		50
#define RECT_HEIGHT		50
namespace Ui {
class wuziqi;
}

class wuziqi : public QMainWindow
{
    Q_OBJECT

public:
    explicit wuziqi(QWidget *parent = 0);
    ~wuziqi();
    void paintEvent(QPaintEvent *event);//绘图事件
    void mousePressEvent(QMouseEvent *event);//鼠标点击事件
    void drawchessboard();//画棋盘函数
    void drawhandchess();//画鼠标棋子函数
    void drawchessitem();//棋盘棋子
    void drawchessatpoint(QPainter&painters,QPoint &point);//画棋子的样式和位置
    int countitem(item it,QPoint pt);//记录某个方向上连接的相同颜色棋子数量

private:
    Ui::wuziqi *ui;
    bool b_black;//定义棋子颜色
    QVector <item> p_item;//定义棋子数组
};

#endif // WUZIQI_H
